mirror of
https://github.com/zebrajr/SamRewritten.git
synced 2025-12-06 00:19:47 +01:00
Bump screenshots, polish code
- Bump screenshots to show off new features - Update README examples to reflect the help text (though the posistional arguments can go at the end!) - Minor code changes to clean up some inconsistencies
This commit is contained in:
parent
18818c0c55
commit
8e1dd4ba13
10
README.MD
10
README.MD
|
|
@ -64,7 +64,7 @@ This last one warrants some explanation. SamRewritten allows you to specify acro
|
|||
|
||||
# Command line options
|
||||
|
||||
I know you linux geeks love to use command line options! SamRewritten's commandline can do all the operations its GUI can!
|
||||
I know you linux geeks love to use command line options! SamRewritten's commandline can do all the operations its GUI can! If no commandline arguments are given, the GUI will be launched.
|
||||
|
||||
```
|
||||
Usage:
|
||||
|
|
@ -115,19 +115,19 @@ Change an achievement or stat value:
|
|||
|
||||
```
|
||||
# Find what you want from the --ls command for app id 54 (you can retrieve app ids from the store page URL).
|
||||
samrewritten --ls 54
|
||||
samrewritten 54 --ls
|
||||
|
||||
# Say we found achievements with IDs ach_500_kills and ach_found_something and stats stat_num_kills, stat_num_deaths
|
||||
# Modify them like this
|
||||
samrewritten --unlock ach_500_kills,ach_found_something 54
|
||||
samrewritten --statnames stat_num_kills,stat_num_deaths --statvalues 10,1 54
|
||||
samrewritten 54 --unlock ach_500_kills,ach_found_something
|
||||
samrewritten 54 --statnames stat_num_kills,stat_num_deaths --statvalues 10,1
|
||||
```
|
||||
|
||||
Use the timed unlock on the commandline
|
||||
|
||||
```
|
||||
# Using the same achievements from the previous example
|
||||
samrewritten --timed --unlock ach_500_kills,ach_found_something --amount 4 --units hours --spacing random --order random 54
|
||||
samrewritten 54 --timed --unlock ach_500_kills,ach_found_something --amount 4 --units hours --spacing random --order random
|
||||
```
|
||||
|
||||
---
|
||||
|
|
|
|||
Binary file not shown.
|
Before Width: | Height: | Size: 142 KiB After Width: | Height: | Size: 133 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 72 KiB After Width: | Height: | Size: 99 KiB |
|
|
@ -153,7 +153,7 @@ bool go_cli_mode(int argc, char* argv[], AppId_t *return_app_id) {
|
|||
<< (is_permission_protected(achievement.permission) ? "Yes" : "No") << std::endl;
|
||||
}
|
||||
|
||||
std::cout << std::endl;;
|
||||
std::cout << std::endl;
|
||||
|
||||
if ( stats.size() == 0 )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ MySteam::comp_app_name(Game_t app1, Game_t app2) {
|
|||
*/
|
||||
bool
|
||||
MySteam::comp_change_num(AchievementChange_t change1, AchievementChange_t change2) {
|
||||
return change1.num < change2.num;
|
||||
return change1.selection_num < change2.selection_num;
|
||||
}
|
||||
// => comp_change_num
|
||||
|
||||
|
|
@ -210,26 +210,26 @@ MySteam::add_modification_ach(const std::string& ach_id, bool new_value) {
|
|||
#endif
|
||||
|
||||
// A value to save off the order we put them in the map
|
||||
static uint64_t modification_num = 0;
|
||||
static uint64_t selection_num = 0;
|
||||
|
||||
if ( m_pending_ach_modifications.find(ach_id) == m_pending_ach_modifications.end() ) {
|
||||
|
||||
modification_num++;
|
||||
if (modification_num == 0) {
|
||||
selection_num++;
|
||||
if (selection_num == 0) {
|
||||
// We've overflowed UINT64_MAX modifications.. impressive
|
||||
// Reset the current array
|
||||
for (auto& [key, val] : m_pending_ach_modifications) {
|
||||
val.num = ++modification_num;
|
||||
val.selection_num = ++selection_num;
|
||||
}
|
||||
modification_num++;
|
||||
if (modification_num == 0) {
|
||||
selection_num++;
|
||||
if (selection_num == 0) {
|
||||
std::cerr << "Error: more than UINT64_MAX achievement modifications" << std::endl;
|
||||
zenity();
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
|
||||
m_pending_ach_modifications.insert( std::pair<std::string, AchievementChange_t>(ach_id, (AchievementChange_t){ach_id, new_value, modification_num} ) );
|
||||
m_pending_ach_modifications.insert( std::pair<std::string, AchievementChange_t>(ach_id, (AchievementChange_t){ach_id, new_value, selection_num} ) );
|
||||
} else {
|
||||
std::cerr << "Warning: Cannot append " << ach_id << ", value already exists." << std::endl;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -303,7 +303,7 @@ MyGameSocket::process_changes(std::vector<AchievementChange_t> achievement_chang
|
|||
}
|
||||
} else {
|
||||
// We want to relock an achievement
|
||||
std::cerr << "Relocking achievement " << achievement_id << std::endl;
|
||||
std::cerr << "Relocking achievement " << achievement_id;
|
||||
if (stats_api->ClearAchievement(achievement_id)) {
|
||||
std::cerr << " succeeded";
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ struct AchievementChange_t {
|
|||
bool achieved;
|
||||
// Used for keeping track of the order an achievement modification
|
||||
// was put into the m_pending_ach_modifications map
|
||||
uint64_t num;
|
||||
uint64_t selection_num;
|
||||
};
|
||||
|
||||
typedef struct AchievementChange_t AchievementChange_t;
|
||||
Loading…
Reference in New Issue
Block a user