mirror of
https://github.com/zebrajr/SamRewritten.git
synced 2025-12-06 12:19:51 +01:00
commit
2d9cd93f53
29
.github/workflows/build.yml
vendored
Normal file
29
.github/workflows/build.yml
vendored
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
# GitHub actions workflow.
|
||||
# https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions
|
||||
|
||||
name: Build CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
tags: [v*]
|
||||
pull_request:
|
||||
types: [opened]
|
||||
branches: [master]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest]
|
||||
cc: [gcc]
|
||||
runs-on: ${{ matrix.os }}
|
||||
env:
|
||||
CC: ${{ matrix.cc }}
|
||||
steps:
|
||||
- run: sudo apt-get update -y
|
||||
- run: sudo apt-get install -y libgtkmm-3.0-dev libcurl4-gnutls-dev libyajl-dev valgrind
|
||||
- uses: actions/checkout@v2
|
||||
- run: make
|
||||
- run: make clean
|
||||
- run: make dev
|
||||
11
.gitignore
vendored
11
.gitignore
vendored
|
|
@ -2,12 +2,13 @@ vgcore.*
|
|||
massif.*
|
||||
/bin/SamRewritten
|
||||
/bin/samrewritten
|
||||
build/
|
||||
/glade/*.glade~
|
||||
/glade/*.glade#
|
||||
obj/*
|
||||
package/AppDir/*
|
||||
package/pkg/*
|
||||
package/src/*
|
||||
package/SamRewritten/*
|
||||
package/AppDir/
|
||||
package/pkg/
|
||||
package/src/
|
||||
package/SamRewritten/
|
||||
package/SamRewritten*.AppImage
|
||||
package/samrewritten*.tar.*
|
||||
obj/
|
||||
|
|
|
|||
50
Makefile
50
Makefile
|
|
@ -1,29 +1,49 @@
|
|||
CXX=g++ -std=c++17
|
||||
RM=rm -f
|
||||
RMDIR=rm -rf
|
||||
CXXFLAGS+=-std=c++17
|
||||
OBJDIR=obj
|
||||
LIBDIR?=lib
|
||||
PREFIX=/usr
|
||||
HFILES:=$(shell find src/ -type f -iname *.h -print)
|
||||
CXXFILES:=$(shell find src/ -type f -iname *.cpp -print)
|
||||
GTKFLAGS=$(shell pkg-config gtkmm-3.0 --cflags --libs)
|
||||
CXXFLAGS=$(GTKFLAGS) -Wall -lsteam_api -lcurl -lyajl -ldl
|
||||
LDFLAGS=-L${CURDIR}/bin
|
||||
OBJDIR=obj
|
||||
PKG_CONFIG?=pkg-config
|
||||
GTKFLAGS:=$(shell $(PKG_CONFIG) gtkmm-3.0 --cflags)
|
||||
GTKLIBS:=$(shell $(PKG_CONFIG) gtkmm-3.0 --libs)
|
||||
# For now, leave it to the distro to provide preferred extra flags
|
||||
CXXFLAGS+=$(GTKFLAGS) -Wall
|
||||
LDLIBS+=$(GTKLIBS) -lsteam_api -lcurl -lyajl -ldl
|
||||
LDFLAGS+=-L${CURDIR}/bin
|
||||
OBJS=$(addprefix ${OBJDIR}/,$(subst .cpp,.o,${CXXFILES}))
|
||||
|
||||
all: CXXFLAGS += -O3
|
||||
all: ${CURDIR}/bin/samrewritten
|
||||
@echo -e "==== Use '\033[1mmake dev\033[0m' to keep debug symbols"
|
||||
@echo -e "==== Use '\033[1mmake clean\033[0m' to remove object files"
|
||||
@echo -e "==== Nothing left to do."
|
||||
@printf "==== %b\n" \
|
||||
"Use '\033[1mmake dev\033[0m' to keep debug symbols" \
|
||||
"Use '\033[1mmake clean\033[0m' to remove object files" \
|
||||
"Nothing left to do."
|
||||
|
||||
dev: CXXFLAGS += -g -DDEBUG_CERR
|
||||
dev: ${CURDIR}/bin/samrewritten
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
${RMDIR} ${OBJDIR}
|
||||
rm -rf ${OBJDIR}
|
||||
|
||||
.PHONY: install
|
||||
install: bin/launch.sh bin/samrewritten bin/libsteam_api.so
|
||||
# TODO: use install for all of these?
|
||||
mkdir -p ${DESTDIR}${PREFIX}/${LIBDIR}/SamRewritten/{bin,glade,assets}
|
||||
mkdir -p ${DESTDIR}${PREFIX}/share/icons/hicolor/{64x64,256x256}/apps
|
||||
mkdir -p ${DESTDIR}${PREFIX}/share/applications
|
||||
mkdir -p ${DESTDIR}${PREFIX}/bin
|
||||
cp $^ ${DESTDIR}${PREFIX}/${LIBDIR}/SamRewritten/bin/
|
||||
ln -s ${DESTDIR}${PREFIX}/${LIBDIR}/SamRewritten/bin/launch.sh ${DESTDIR}${PREFIX}/bin/samrewritten
|
||||
cp glade/main_window.glade ${DESTDIR}${PREFIX}/${LIBDIR}/SamRewritten/glade/main_window.glade
|
||||
cp assets/icon_64.png ${DESTDIR}${PREFIX}/share/icons/hicolor/64x64/apps/samrewritten.png
|
||||
cp assets/icon_256.png ${DESTDIR}${PREFIX}/share/icons/hicolor/256x256/apps/samrewritten.png
|
||||
cp assets/icon_256.png ${DESTDIR}${PREFIX}/${LIBDIR}/SamRewritten/assets/
|
||||
cp package/samrewritten.desktop ${DESTDIR}${PREFIX}/share/applications/
|
||||
|
||||
${CURDIR}/bin/samrewritten: $(OBJS)
|
||||
${CXX} -o ${CURDIR}/bin/samrewritten $(OBJS) ${LDFLAGS} ${CXXFLAGS}
|
||||
${CXX} -o ${CURDIR}/bin/samrewritten $(OBJS) ${LDFLAGS} ${CXXFLAGS} ${LDLIBS}
|
||||
|
||||
${OBJDIR}/%.o: %.cpp $(HFILES)
|
||||
@mkdir -p $$(dirname $@)
|
||||
$(CXX) -c -o $@ $< ${LDFLAGS} $(CXXFLAGS)
|
||||
@mkdir -p $(@D)
|
||||
$(CXX) -c -o $@ $< ${CXXFLAGS}
|
||||
|
|
|
|||
|
|
@ -22,6 +22,8 @@ It comes with third-party tools integration and a nice user interface.
|
|||
|
||||
SamRewritten is constantly under development, if you think you can give us a hand, feel free to reach us :)
|
||||
|
||||
### ⚠️ As of now, SamRewritten only works if Steam has been installed through your package manager (apt, pacman, ...)
|
||||
|
||||
# Building
|
||||
|
||||
To build this project, clone this repository on your PC, and run the `make` command within the repository folder that you downloaded.
|
||||
|
|
@ -43,12 +45,18 @@ If you're encountering issues building SamRewritten, make sure you have installe
|
|||
|
||||
To run SamRewritten, simply launch `$ ./bin/launch.sh`
|
||||
|
||||
# AUR Installation
|
||||
## AUR Installation
|
||||
|
||||
You can install SamRewritten from the AUR by installing the `samrewritten-git` package.
|
||||
|
||||
Run SamRewritten by opening the corresponding desktop entry, or by using the `samrewritten` command.
|
||||
|
||||
## Gentoo Installation
|
||||
|
||||
SamRewritten is available as `games-util/samrewritten` through the following overlay:
|
||||
|
||||
https://github.com/telans/EBUILDS
|
||||
|
||||
# Features
|
||||
|
||||
SamRewritten's features match and exceed the original SAM:
|
||||
|
|
@ -140,4 +148,4 @@ SamRewritten uses JSON to communicate between the interface and the "backend log
|
|||
|
||||
## Footnotes
|
||||
|
||||
This software is licensed under the GNU GPL v3 and comes with no warranty. Use it at your own risk. We believe you should not get any ban using it, but we do not take any responsability over your user experience
|
||||
This software is licensed under the GNU GPL v3 and comes with no warranty. Use it at your own risk. We believe you should not get any ban using it, but we do not take any responsibility over your user experience.
|
||||
|
|
@ -1,10 +1,10 @@
|
|||
#!/bin/bash
|
||||
|
||||
SCRIPT_PATH=`dirname $(realpath $0)`
|
||||
SCRIPT_PATH=$(dirname "$(realpath "$0")")
|
||||
export LD_LIBRARY_PATH=${SCRIPT_PATH}
|
||||
|
||||
# Workaround waiting for a fix https://github.com/lloyd/yajl/issues/222
|
||||
export LC_NUMERIC=en_US.UTF-8
|
||||
|
||||
cd ${SCRIPT_PATH}/..
|
||||
${SCRIPT_PATH}/samrewritten $@
|
||||
cd "${SCRIPT_PATH}"/..
|
||||
"${SCRIPT_PATH}"/samrewritten "$@"
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
#!/bin/bash
|
||||
|
||||
SCRIPT_PATH=`dirname $(realpath $0)`
|
||||
SCRIPT_PATH=$(dirname "$(realpath "$0")")
|
||||
export LD_LIBRARY_PATH=${SCRIPT_PATH}
|
||||
|
||||
# Workaround waiting for a fix https://github.com/lloyd/yajl/issues/222
|
||||
export LC_NUMERIC=en_US.UTF-8
|
||||
|
||||
cd ${SCRIPT_PATH}/..
|
||||
cd "${SCRIPT_PATH}"/..
|
||||
rm -f /tmp/sam-massif.out
|
||||
valgrind --tool=massif --massif-out-file=/tmp/sam-massif.out ${SCRIPT_PATH}/samrewritten $@
|
||||
massif-visualizer /tmp/sam-massif.out
|
||||
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
pkgname="samrewritten-git"
|
||||
_pkgname="SamRewritten"
|
||||
pkgver=r133.a839930
|
||||
pkgver=r199.916d83d
|
||||
pkgrel=1
|
||||
pkgdesc="A Steam Achievement Manager For Linux."
|
||||
arch=("any")
|
||||
|
|
@ -28,14 +28,6 @@ build() {
|
|||
}
|
||||
|
||||
package() {
|
||||
install -dm755 "${pkgdir}/usr/lib/"
|
||||
# Only copy required files. (Except for Glade files, as more may be added in the future.)
|
||||
cp -r --parents ${_pkgname}/{LICENSE,README.MD,bin/{launch.sh,libsteam_api.so,samrewritten},glade/*.glade,assets/icon_256.png} ${pkgdir}/usr/lib/
|
||||
install -Dm644 ${_pkgname}/assets/icon_256.png ${pkgdir}/usr/share/icons/hicolor/256x256/apps/samrewritten.png
|
||||
install -Dm644 ${_pkgname}/assets/icon_64.png ${pkgdir}/usr/share/icons/hicolor/64x64/apps/samrewritten.png
|
||||
# Executable
|
||||
install -dm755 ${pkgdir}/usr/bin
|
||||
ln -s /usr/lib/${_pkgname}/bin/launch.sh ${pkgdir}/usr/bin/samrewritten
|
||||
# Desktop Entry
|
||||
install -Dm644 ${_pkgname}/package/samrewritten.desktop ${pkgdir}/usr/share/applications/samrewritten.desktop
|
||||
cd ${_pkgname}
|
||||
make DESTDIR=${pkgdir} install
|
||||
}
|
||||
|
|
@ -335,6 +335,7 @@ MySteam::setup_timed_modifications(uint64_t seconds, MODIFICATION_SPACING spacin
|
|||
// fetching achievements in CLI mode.
|
||||
|
||||
std::vector<uint64_t> times;
|
||||
std::vector<uint64_t> rel_times;
|
||||
size_t size = m_pending_ach_modifications.size();
|
||||
|
||||
if (size == 0) {
|
||||
|
|
@ -364,19 +365,20 @@ MySteam::setup_timed_modifications(uint64_t seconds, MODIFICATION_SPACING spacin
|
|||
|
||||
for (size_t i = 0; i < size; i++) {
|
||||
std::cout << "Modify achievement " << m_achievement_changes[i].id << " in " << times[i] << " seconds"
|
||||
<< " (or " << (((double)times[i]) / 60) << " minutes or " << (((double)times[i]) / 60) << " hours)" << std::endl;
|
||||
<< " (or " << (((double)times[i]) / 60) << " minutes or " << ((((double)times[i]) / 60) / 60) << " hours)" << std::endl;
|
||||
}
|
||||
|
||||
// Put times in order since we'll use the differences from one to the next
|
||||
std::sort(times.begin(), times.end());
|
||||
|
||||
// Make relative times
|
||||
rel_times.push_back(times[0]);
|
||||
for (size_t i = 1; i < size; i++)
|
||||
{
|
||||
times[i] = times[i] - times[i - 1];
|
||||
rel_times.push_back(times[i] - times[i - 1]);
|
||||
}
|
||||
|
||||
return times;
|
||||
return rel_times;
|
||||
}
|
||||
// => commit_timed_modifications
|
||||
|
||||
|
|
@ -439,3 +441,4 @@ MySteam::set_special_flags() {
|
|||
m_achievements[next_most_achieved_index].special |= ACHIEVEMENT_NEXT_MOST_ACHIEVED;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -212,6 +212,8 @@ void
|
|||
MainPickerWindow::on_refresh_achievements_button_clicked() {
|
||||
g_steam->clear_changes();
|
||||
m_async_loader.populate_achievements();
|
||||
m_display_only_locked_button->set_active(false);
|
||||
m_display_only_unlocked_button->set_active(false);
|
||||
}
|
||||
// => on_refresh_achievements_button_clicked
|
||||
|
||||
|
|
@ -233,6 +235,8 @@ void
|
|||
MainPickerWindow::on_store_button_clicked() {
|
||||
g_steam->commit_changes();
|
||||
m_async_loader.populate_achievements();
|
||||
m_display_only_locked_button->set_active(false);
|
||||
m_display_only_unlocked_button->set_active(false);
|
||||
}
|
||||
// => on_store_button_clicked
|
||||
|
||||
|
|
@ -297,6 +301,8 @@ MainPickerWindow::on_cancel_timed_modifications_button_clicked() {
|
|||
m_submit_timed_modifications_button->show();
|
||||
m_applying_modifications_label->hide();
|
||||
m_timed_modifications_window->hide();
|
||||
m_display_only_locked_button->set_active(false);
|
||||
m_display_only_unlocked_button->set_active(false);
|
||||
}
|
||||
// => on_close_timed_modifications_window
|
||||
|
||||
|
|
@ -335,7 +341,7 @@ MainPickerWindow::on_submit_timed_modifications_button_clicked() {
|
|||
} else if (active_time_id == "days_id") {
|
||||
time *= 60 * 60 * 24;
|
||||
} else {
|
||||
std::cerr << "unkown time unit!" << std::endl;
|
||||
std::cerr << "unknown time unit!" << std::endl;
|
||||
}
|
||||
|
||||
if (m_even_spacing_button->get_active()) {
|
||||
|
|
@ -343,7 +349,7 @@ MainPickerWindow::on_submit_timed_modifications_button_clicked() {
|
|||
} else if (m_random_spacing_button->get_active()) {
|
||||
spacing = RANDOM_SPACING;
|
||||
} else {
|
||||
std::cerr << "unkown spacing!" << std::endl;
|
||||
std::cerr << "unknown spacing!" << std::endl;
|
||||
}
|
||||
|
||||
if (m_order_of_selection_button->get_active()) {
|
||||
|
|
@ -351,7 +357,7 @@ MainPickerWindow::on_submit_timed_modifications_button_clicked() {
|
|||
} else if (m_order_random_button->get_active()) {
|
||||
order = RANDOM_ORDER;
|
||||
} else {
|
||||
std::cerr << "unkown order!" << std::endl;
|
||||
std::cerr << "unknown order!" << std::endl;
|
||||
}
|
||||
|
||||
m_timed_modification_times = g_steam->setup_timed_modifications(time, spacing, order);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user